﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Core.Model
{
    /// <summary>
    /// 树形接口
    /// </summary>
    /// <typeparam name="TEntity"></typeparam>
    public interface INode<TEntity> : IItem
        where TEntity : IItem
    {
        int? ParentId { get; set; }

        /// <summary>
        /// 父节点
        /// </summary>
        TEntity Parent { get; set; }

        /// <summary>
        /// 子节点
        /// </summary>
        ICollection<TEntity> Children { get; set; }

        /// <summary>
        /// 当前节点在树中的路径
        /// </summary>
        string Path { get; set; }

        /// <summary>
        /// 层级
        /// </summary>
        int? Level { get; set; }

        /// <summary>
        /// 是否最末级
        /// </summary>
        bool? Leaf { get; set; }
    }
}
